package com.leetcode;


import java.util.Stack;

public class L0232 {

}
class MyQueue {
    Stack<Integer>  stack1;
    Stack<Integer>  stack2;
    public MyQueue() {
        stack1=new Stack<Integer>();
        stack2=new Stack<Integer>();
    }

    public void push(int x) {
        stack1.push(x);
    }

    public int pop() {
        while (!stack1.empty()){
            stack2.push(stack1.pop());
        }
        return stack2.pop();
    }

    public int peek() {
        while (!stack1.empty()){
            stack2.push(stack1.pop());
        }
        return stack2.peek();
    }

    public boolean empty() {
        if (stack1.empty()&&stack2.empty())
            return true;
        else
            return false;
    }
}